import React, { Component } from 'react';

import { getExample } from '@/api/example';

export default class App extends Component {
  constructor(props) {
    super();

    this.state = {
      message: 'app'
    };
  }

  async componentDidMount() {
    this.getExample();
  }

  async getExample() {
    const res = await getExample();

    this.setState({
      message: this.state.message + ' ' + res.data.data
    });
  }

  render() {
    return (
      <h1>{ this.state.message }</h1>
    );
  }
}
